<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.naming.Context"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import="javax.sql.DataSource"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Edit <%=request.getUserPrincipal().getName()%></title>
<link rel="stylesheet" href="../style/layout.css" type="text/css" />
<link rel="stylesheet" href="../style/popup.css" type="text/css" />
<link rel="stylesheet" href="../style/datepicker.css" type="text/css" />
<link rel="stylesheet" href="../style/menu_style.css" type="text/css" />
<script type="text/javascript" src="../scripts/jquery.js"></script>
<script type="text/javascript" src="../scripts/date.js"></script>
<script type="text/javascript" src="../scripts/datepicker.js"></script>
<script type="text/javascript" src="../scripts/formViewer.js"></script>
<script type="text/javascript" src="../scripts/clock.js"></script>
</head>
<body onload="updateClock(); setInterval('updateClock()',1000)">

    <%@ include file="/include/header.jsp" %>
    <div id="mainContainer">
	    <div id="mainContent">
	    			<div id="title">Edit <%=request.getUserPrincipal().getName()%></div>
					<html:form  action="/registered/updateUser">
						<html:hidden property="userId"/>
						<label for="email">Email:</label>
						<html:text property="email" maxlength="100"/>
						<span id="error">${ errorMessages.email }<html:errors property="email" /></span>
						<br/>
						<label for="password">New password(leave blank if you don't want to change it):</label>
						<html:password property="password" />
						<span id="error"><html:errors property="password" /></span>
						<br/>
						<label for="password2">Repeat new password:</label>
						<html:password property="password2" />
						<span id="error"><html:errors property="password2" /></span>
						<br/>
						<label for="bio">Bio:</label>
						<html:textarea rows="2" cols="30" property="bio"></html:textarea>
						<span id="error"><html:errors property="bio" /></span>
						<br/>
						<input type="submit" value="Update user profile"/>
					</html:form>
					<br/>
					<span>${ success }</span>
	    </div>
	    <%@ include file="/include/menu.jsp" %>
    </div>
</body>
</html>